package com.qf.controller;

import com.qf.entity.Department;
import com.qf.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 2019/11/29
 * 郭程鹏
 * gcp1909
 * 面向代码面向君,不负时光不负卿
 */
@Controller
public class DeptController {
    @Autowired
    private DeptService deptService;

    @RequestMapping("/resource/demo1/ifm")
    @ResponseBody
    public List<Department> allDept(Model model){

        List<Department> allDept = deptService.allDept();

        return allDept;
    }
}
